/*
 * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙，邂逅框架梦]
 * 
 * https://zhiqim.org/project/zhiqim_framework/zhiqim_kernel.htm
 *
 * Zhiqim Kernel is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *          http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */
package org.zhiqim.kernel.model.lists;

import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;

/**
 * 定义一个HashSet<V>抽象类，包含HashSet基本方法
 *
 * @version v1.0.0 @author zouzhigang 2016-10-25 新建与整理
 */
public abstract class HashSetV<V>
{
    protected HashSet<V> instance;
    
    /***********************************************************/
    //业务使用的方法
    /***********************************************************/
    
    /**
     * 返回对应的List实例
     * 
     * @return          List实例
     */
    public HashSet<V> instance()
    {
        return instance;
    }
    
    /***********************************************************/
    //以为实现Set的所有方法
    /***********************************************************/
    
    public int size()
    {
        return instance.size();
    }

    public boolean isEmpty()
    {
        return instance.isEmpty();
    }

    public boolean contains(V o)
    {
        return instance.contains(o);
    }

    public Iterator<V> iterator()
    {
        return instance.iterator();
    }

    public boolean add(V e)
    {
        return instance.add(e);
    }

    public boolean remove(V o)
    {
        return instance.remove(o);
    }

    public boolean containsAll(Collection<V> c)
    {
        return instance.containsAll(c);
    }

    public boolean addAll(Collection<V> c)
    {
        return instance.addAll(c);
    }

    public boolean retainAll(Collection<V> c)
    {
        return instance.retainAll(c);
    }

    public boolean removeAll(Collection<V> c)
    {
        return instance.removeAll(c);
    }

    public void clear()
    {
        instance.clear();
    }
    
    public String toString()
    {
        return instance.toString();
    }
}
